#include <iostream>
#include <cmath>
using namespace std;

long double area_of_square(long double side = 0)
{
    return side * side;
}

long double area_of_circle(long double radius = 0)
{
    return radius * radius * M_PI;
}

long double area_of_triangle(long double side1 = 0,long double side2 = 0,long double side3 = 0)
{
    long double p = (side1+side2+side3)/2;
    return sqrtl(p*(p-side1)*(p-side2)*(p-side3));
}

int main(){
    cout<<"To calculate the area, please choose a geometrical shape:"<<endl;
    cout<<"1. Triange"<<endl;
    cout<<"2. Square"<<endl;
    cout<<"3. Circle"<<endl;
    cout<<"0. Exit"<<endl;

    int x;

    cout<<"Your choice:";
    cin>>x;
    switch(x){
        case 1:{
            cout<<"Please input the lengthes of three sides of a triangle:";
            long double a,b,c;
            cin>>a>>b>>c;
            cout<<"The area of your triangle is:"<<area_of_triangle(a,b,c)<<endl;
            break;
        }
        case 2:{
            cout<<"Please input the length of a sides of a square:";
            long double a;
            cin>>a;
            cout<<"The area of your square is:"<<area_of_square(a)<<endl;
            break;
        }
        case 3:{
            cout<<"Please input the length of one radius of a circle:";
            long double a;
            cin>>a;
            cout<<"The area of your circle is:"<<area_of_circle(a)<<endl;
            break;
        }
        default:;
    }
}

